package org.colafries.admin.entity.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

/**
 * @author colafries
 * @version v1.0
 * @ClassName CustomTable
 * @Description
 * @date Created in 2024/4/8
 **/
@Data
@TableName("t_custom_table")
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Accessors(chain = true)
public class CustomTable {
    /**
     * 自定义数据表id
     */
    @TableId(value = "id",type = IdType.AUTO)
    private Integer id;
    /**
     * 自定义表唯一值
     */
    @TableField("code")
    private String code;
    /**
     * 自定义数据表名称
     */
    @TableField("name")
    private String name;
    /**
     * 自定义表Hash值
     */
    @TableField("table_hash")
    private String tableHash;
    /**
     * 自定义SQL
     */
    @TableField("custom_sql")
    private String customSql;
    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    /**
     * 修改时间
     */
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
    /**
     * 修改人
     */
    @TableField("update_user")
    private String updateUser;
    /**
     * 数据模型id
     */
    @TableField("data_model_id")
    private Integer dataModelId;
    /**
     * 数据模型code
     */
//    @TableField("data_model_code")
//    private String dataModelCode;
}
